package class1;

public class SpecialMember extends Member {
    private String privilege;//优惠
    public SpecialMember(String name, int no, int age, String privilege){
        super(name,no,age); this.privilege=privilege;

    }public void print(){super.print();
        System.out.println("优惠"+privilege);
    }

}
class MemberTester{
public static void main(String[]args){
       Member m[]={
               new Member("张淳柏",101,21),
               new SpecialMember("张旺",102,20,"会员免费"),
               new SpecialMember("谢加利",103,20,"会员免费"),
       };

//    for (Member k:m){
//            k.print();
//            System.out.println();

//    }
    for (int i = 0; i <m.length ; i++) {
        m[i].print();
        System.out.println();
    }
        }
}
